from sqlalchemy import Column, Integer, String, DECIMAL, DateTime
from sqlalchemy.sql import func
from .Base import Base

class CardTransaction(Base):
    __tablename__ = "card_transaction"

    id = Column(Integer, primary_key=True, index=True, autoincrement=True)
    card_id = Column(Integer, nullable=False, index=True)
    amount = Column(DECIMAL(10, 2), nullable=False)
    transaction_type = Column(String(20), nullable=False)
    description = Column(String(255))
    created_at = Column(DateTime(timezone=True), server_default=func.now())
